[ $A = "README" ] && continue
ALIST="{ \"$A\", $A } , $ALIST"
echo "static char $A[] = "
- sed 's/"/\\"/g;s/\(^.\)/"\1/g;s/\(.$\)/\1\\\n"/g' $i
+ sed 's/\\/\\\\/;s/"/\\"/g;s/\(^.\)/"\1/g;s/\(.$\)/\1\\\n"/g' $i
echo ";"
done
*/
/* whack off any comments */
- if ((p = strchr(sbuff, '#')) != NULL)
- *p = '\0';
+ if ((p = strchr(sbuff, '#')) != NULL) {
+ if ((p > sbuff) && p[-1] == '\\') {
+ memmove(p-1, p, strlen(p));
+ p[strlen(p)-1] = '\0';
+ } else {
+ *p = '\0';
+ }
+ }
if (strlen(sbuff)) {
if (ISSTOKEN(sbuff, "FIELD_DELIMITER")) {